import request from '@/utils/request'

// 获取用户信息
export function userInfo(data){
  return request({
    url:'/wx/user/getUserInfo',
    method:'post',
    data:data
  })
}
export function getAllMonth(query) {
  return new Promise((resolve,reject)=>{
    resolve(request({
      url: 'https://hometasty.hk/demo/oderkj.php',
      method: 'get',
      params: query
    }))
  })
}
export function fetchList2(query) {
  return request({
    url: 'https://api.dianmihl.com/shop2/admin/user/list',
    method: 'get',
    params: query
  })
}
export function findZzjg(query) {
    return new Promise((resolve,reject)=>{
        resolve(request({
            url: '/shop2/admin/user/findZzjg',
            method: 'post',
            params: query
        }))
    })
}
// 获取地址列表
export function levelList(data){
  return request({
    url:'/shop2/wx/pv/findZzjg',
    method:'get',
    params:data
  })
}
// 修改用户信息
export function updateUserInfo(data){
  return request({
    url:'/wx/user/updateUserInfo',
    method:'post',
    data:data
  })
}

// 获取地址列表
export function addresslist(data){
  return request({
    url:'/wx/address/list',
    method:'post',
    data:data
  })
}

// 添加修改地址信息
export function addressAddUpdate(data){
  return request({
    url:'/wx/address/save',
    method:'post',
    data:data
  })
}

// 查看收货地址
export function addressDetail(data){
  return request({
    url:'/wx/address/detail',
    method:'post',
    data:data
  })
}

// 删除收货地址
export function addressDelete(data){
  return request({
    url:'/wx/address/delete',
    method:'post',
    data:data
  })
}

// 收货地址修改为默认
export function updateDefaultAdd(data){
  return request({
    url:'/wx/address/updateDefaultAdd',
    method:'post',
    data:data
  })
}
// pv升级
export function innserBank(data){
  return request({
    url:'/wx/pv/innserBank',
    method:'post',
    data:data
  })
}
// 我的pv

export function mypv(data){
  return request({
    url:'/wx/pv/mypv',
    method:'post',
    data:data
  })
}
// 我的职位

export function mypost(data){
  return request({
    url:'/wx/pv/mypost',
    method:'post',
    data:data
  })
}

// 升级經銷商
export function upgrade(data){
  return request({
    url:'/wx/pv/askForPromote',
    method:'post',
    data:data
  })
}

// 升级页面查看是否升过级
export function getBank(data){
  return request({
    url:'/wx/pv/getBank',
    method:'get',
    params:data
  })
}


// 升级修改
export function updateBank(data){
  return request({
    url:'/wx/pv/update',
    method:'post',
    data:data
  })
}